
def headings(env, start_response):
    headerList = env.get("whiff.middleware.headingList")
    start_response("200 OK", [('Content-Type', 'text/html')])
    if headerList:
        yield '\nContents:<br><blockquote>\n'
        for (level, name, text) in headerList:
            yield '<a href="#%s">%s</a><br>\n'% (name, text)
        yield '</blockquote>\n\n'
    else:
        yield "\n<!-- no content using -->\n"

__wsgi__ = headings
